package org.lab.study.other;

import org.lab.data.Quote;
import org.lab.data.Ticker;
import org.lab.indicator.basic.SMA;
import org.lab.study.Study;


public class STDev extends Study{
	private float profitPercents = 0f;
	private float percentPos = 0;
	private float amount = 100;
	private int size = 0;
	
	private String stdticker;
	
	private float std = 0;
	
	public STDev(String stdticker) {
		this.stdticker = stdticker;
	}
	
	public void run(Ticker ticker) {
				
		Quote[] array = new Quote[ticker.getQuotes().size()];
		std = new SMA(stdticker).getStandardDeviation((Quote[]) ticker.getQuotes().toArray(array));
		
		System.out.println("STDev: " + std);
		
		Quote[] array2 = new Quote[200];
		std = new SMA(stdticker).getStandardDeviation((Quote[]) ticker.getQuotes(200).toArray(array2));
		
		System.out.println("STDev 200: " + std);
		
	}
}
